package com.hs.live.user.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hs.live.user.dto.UserDTO;
import com.hs.live.user.service.LoginService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
    * ⽤户基础信息表
    */
@ApiModel(description="⽤户基础信息表")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_user")
public class UserDO implements Serializable {
    /**
     * 用户id
     */
    @TableId(value = "user_id", type = IdType.INPUT)
    @ApiModelProperty(value="用户id")
    private Long userId;

    /**
     * 昵称
     */
    @TableField(value = "nick_name")
    @ApiModelProperty(value="昵称")
    private String nickName;

    /**
     * 头像
     */
    @TableField(value = "avatar")
    @ApiModelProperty(value="头像")
    private String avatar;

    /**
     * 真实姓名
     */
    @TableField(value = "true_name")
    @ApiModelProperty(value="真实姓名")
    private String trueName;

    /**
     * 性别 0男，1⼥
     */
    @TableField(value = "sex")
    @ApiModelProperty(value="性别 0男，1⼥")
    private Integer sex;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @ApiModelProperty(value="创建时间")
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value="修改时间")
    private Date updateTime;

    public static UserDO generateUser(Long id){
        UserDO UserDO = new UserDO();
        UserDO.setUserId(id);
        UserDO.setNickName("new");
        UserDO.setAvatar("/img/avatar.png");
        UserDO.setTrueName("新用户");
        UserDO.setSex(0);
        return UserDO;
    }

    private static final long serialVersionUID = 1L;
}